package com.mkh.st.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum RoleLevelEnum {
	/**
	 * 是
	 */
	ZERO(0, "租户管理员","tenant","自定义"),
	/**
	 * 否
	 */
	ONE(1, "系统级","administrator","预定义");

	/**
	 * 类型
	 */
	private Integer code;

	/**
	 * 描述
	 */
	private String description;

	private String roleCode;

	private String resource;

	public static RoleLevelEnum get(Integer code){
		if (Objects.isNull(code)) {
			return null;
		}
		for (RoleLevelEnum roleLevelEnum : RoleLevelEnum.values()){
			if (code.equals(roleLevelEnum.code))  return roleLevelEnum;
		}
		return null;
	}
}
